package com.atgion.manager.service;

import com.atgion.spzx.model.dto.system.SysUserLoginParam;
import com.atgion.spzx.model.entity.system.CreateUserParam;
import com.atgion.spzx.model.entity.system.SysUser;
import com.atgion.spzx.model.entity.system.ValidateCodeVo;
import com.atgion.spzx.model.vo.base.Result;
import com.atgion.spzx.model.vo.system.LoginResult;
import com.atgion.spzx.model.vo.system.SysUserVO;
import com.atgion.spzx.model.vo.system.UserInfoVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;
import java.util.Map;

public interface SysUserService extends IService<SysUser> {

    /**
     * 分页获取数据
     *
     * @param params 查询参数
     * @return IPage<SysUserVO>
     */
    IPage<SysUserVO> getList(Map<String, Object> params);

    /**
     * 登录
     *
     * @param sysUserLoginParam 验证信息
     * @return 生成的JWT的token
     */
    LoginResult login(SysUserLoginParam sysUserLoginParam);

    /**
     * 创建用户
     *
     * @param createUserParam 创建用户信息
     * @return 创建结果
     */
    Result<String> createUser(CreateUserParam createUserParam);

    /**
     * 获取用户信息
     *
     * @return UserInfoVO
     */
    Result<UserInfoVO> getUserInfo(String authorizationHeader);

    /**
     * 修改用户信息
     *
     * @param createUserParam 修改用户信息
     * @return 修改结果
     */
    Result<String> updateUser(CreateUserParam createUserParam);

    void removeByid(List<Integer> ids);

    Boolean resetPassword(String password, Long userId);

    ValidateCodeVo generateValidateCode();

    void logout(String authorizationHeader);
}
